package com.younion.vo;

import java.util.Date;

import com.younion.common.constants.RoleType;

import cpcns.component.common.base.BaseVO;
import cpcns.persister.converter.IDomainObject;
import cpcns.persister.service.CompositeID;


 
public class RolesVO extends BaseVO implements IDomainObject,Cloneable{

	/**  */
	private static final long serialVersionUID = -1L;

	 
	private Integer id;

	 
	private String name;

 
	private String permissions;

 
	private Date createDate;

	 
	private UserVO creator;

	 
	private String description;
	private String roleType;
	
	private String roleTypeTitle;
	
	private Date gtcreateDate;
	private Date ltcreateDate;
	
	private CustomerVO customer;
	private Integer customerId;
	private String customerName;
	

	/**
	 * 
	 */
	public RolesVO() {
	}

	/** 
	 * @return the id
	 */ 
	public Integer getId() {
		return id;
	}

	/** 
	 * @param id the id to set 
	 */ 
	public void setId(Integer id) {
		this.id = id;
	}

	/** 
	 * @return the name
	 */ 
	public String getName() {
		return name;
	}

	/** 
	 * @param name the name to set 
	 */ 
	public void setName(String name) {
		this.name = name;
	}

	/** 
	 * @return the permissions
	 */ 
	public String getPermissions() {
		return permissions;
	}

	/** 
	 * @param permissions the permissions to set 
	 */ 
	public void setPermissions(String permissions) {
		this.permissions = permissions;
	}

	/** 
	 * @return the createDate
	 */ 
	public Date getCreateDate() {
		return createDate;
	}

	/** 
	 * @param createDate the createDate to set 
	 */ 
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public UserVO getCreator() {
		return creator;
	}

	public void setCreator(UserVO creator) {
		this.creator = creator;
	}

	/** 
	 * @return the description
	 */ 
	public String getDescription() {
		return description;
	}

	public String getRoleType() {
		return roleType;
	}

	public void setRoleType(String roleType) {
		this.roleType = roleType;
	}

	/** 
	 * @param description the description to set 
	 */ 
	public void setDescription(String description) {
		this.description = description;
	}
	
	

	public String getRoleTypeTitle() {
		return(getRoleType() == null || "".equals(getRoleType()))  ? null : RoleType.valueOfName(getRoleType()).getTitle();
	}

	public void setRoleTypeTitle(String roleTypeTitle) {
		this.roleTypeTitle = roleTypeTitle;
	}

	public CompositeID getCompositeID(){
		CompositeID _id = super.getCompositeID();
		_id.clear();
		if(id != null){
			_id.addKey("id", id);
		}
		return _id;
	}

	public Date getGtcreateDate() {
		return gtcreateDate;
	}

	public void setGtcreateDate(Date gtcreateDate) {
		this.gtcreateDate = gtcreateDate;
	}

	public Date getLtcreateDate() {
		return ltcreateDate;
	}

	public void setLtcreateDate(Date ltcreateDate) {
		this.ltcreateDate = ltcreateDate;
	}

	public CustomerVO getCustomer() {
		return customer;
	}

	public void setCustomer(CustomerVO customer) {
		this.customer = customer;
	}

	public Integer getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	} 
	
	
}
